"/index\.php$/", "page" => "index", "type" => "0", "id" => "0"), array( "url" => "/\/en\/$/", "page" => "index", "type" => "0", "id" => "0"), # logout array( "url" => "/(\/(deconnexion|en\/logout)(|\/|\?|\/\?([a-zA-Z0-9+\/=&_]+)))$/", "page" => "logout"), # NEWS array( "url" => "/(\/en\/news|\/en\/news\/)$/", "page" => "nouvelles", "type" => "0", "id" => "0"), # NOUVELLES array( "url" => "/(\/nouvelles|\/nouvelles\/)$/", "page" => "nouvelles", "type" => "0", "id" => "0"), # ÉQUIPE array( "url" => "/(\/en\/about-us\/our-team|\/en\/about-us\/our-team\/)$/", "page" => "equipe", "type" => "0", "id" => "0"), # Equipe array( "url" => "/(\/qui-sommes-nous\/notre-equipe|\/qui-sommes-nous\/notre-equipe\/)$/", "page" => "equipe", "type" => "0", "id" => "0"), # moncompte array( "url" => "/(\/(moncompte|en\/myaccount)(|\/|\?|\/\?([a-zA-Z0-9+\/=&_]+)))$/", "page" => "moncompte"), # moncompte array( "url" => "/(\/(moncompte\/informations|moncompte\/inscription|en\/myaccount\/informations)(|\/|\?|\?([a-zA-Z0-9+\/=&_]+)))$/", "page" => "moncompte-informations"), # moncompte array( "url" => "/(\/(moncompte\/tableaudebord|en\/myaccount\/dashboard)(|\/|\?|\?([a-zA-Z0-9+\/=&_]+)))$/", "page" => "moncompte-tableaudebord"), # moncompte array( "url" => "/(\/(moncompte\/motdepasse|en\/myaccount\/password)(|\/|\?|\?([a-zA-Z0-9+\/=&_]+)))$/", "page" => "moncompte-motdepasse"), # boutique / look array( "url" => "/(\/(boutique\/look|en\/shop\/look)\/(?P[a-zA-Z0-9+_\-]*)(|\/|\?|\?([a-zA-Z0-9+\/=&_%\+\-\[\]]+)))$/", "page" => "boutique-look"), # moncompte array( "url" => "/(\/(reinitialiser-mot-de-passe|en\/reset-password)(|\/|\?|\/\?([a-zA-Z0-9+\/=&_]+)))$/", "page" => "reinitialiser"), # boutique / promos array( "url" => "/(\/(promotions|en\/promotions)(|\/|\?|\?([a-zA-Z0-9+\/=&_%\+\-\[\]]+)|\/\?([a-zA-Z0-9+\/=&_%\+\-\[\]]+)))$/", "page" => "boutique-promotion"), # boutique array( "url" => "/(\/(boutique|en\/shop|recherche|en\/search)(|\/|\?|\/\?([a-zA-Z0-9+\/=&_]+)))$/", "page" => "boutique"), # boutique / categorie array( "url" => "/(\/(boutique|en\/shop)\/(?P
[a-zA-Z0-9+_\-]*)\/(?P[a-zA-Z0-9+_\-]*)\/(?P[a-zA-Z0-9+_\-]*)(|\/|\?|\?([a-zA-Z0-9+\/=&_%\+\-\[\]]+)))$/", "page" => "boutique-categorie"), # boutique / marque array( "url" => "/(\/(boutique|en\/shop)\/(?P
[a-zA-Z0-9+_\-]*)\/(?P[a-zA-Z0-9+_\-]*)(|\/|\?|\?([a-zA-Z0-9+\/=&_%\+\-\[\]]+)))$/", "page" => "boutique-marque"), # boutique / marque array( "url" => "/(\/(boutique|en\/shop)\/(?P
[a-zA-Z0-9+_\-]*)(|\/|\?|\?([a-zA-Z0-9+\/=&_%\+\-\[\]]+)))$/", "page" => "boutique-section"), # boutique détail array( "url" => "/(\/(boutique|en\/shop)\/(?P
[a-zA-Z0-9+_\-]*)\/(?P[a-zA-Z0-9+_\-]*)\/(?P[a-zA-Z0-9+_\-]*)\/(?P[a-zA-Z0-9+_\-]*)(|\/|\?([a-zA-Z0-9+\/=&_%\+\-\[\]]+)))$/", "page" => "boutique-detail"), # panier array( "url" => "/(\/(panier|en\/cart)(|\/))$/", "page" => "panier"), # panier array( "url" => "/(\/(caisse|en\/checkout)(|\/))$/", "page" => "caisse"), # panier array( "url" => "/(\/(caisse2|en\/checkout2)(|\/))$/", "page" => "caisse2"), # confirmation array( "url" => "/(\/(confirmation|confirmation)(|\/))/", "page" => "confirmation"), # commander array( "url" => "/(\/(commande|en\/order)\/(?P[0-9+]*)(|\/))$/", "page" => "commande"), # CALENDRIER AVEC SÉLECTION DE DATE array( "url" => "/(\/calendrier|\/calendrier\/)\/(?P[0-9]*)\/(?P[0-9]+)(|\/)$/", "page" => "calendrier2", "type" => "0", "id" => "0"), # NEWLETTER array( "url" => "/(\/en\/newsletter|\/en\/newsletter\/)$/", "page" => "infolettre", "type" => "0", "id" => "0") , # INFOLETTRE array( "url" => "/(\/infolettre|\/infolettre\/)$/", "page" => "infolettre", "type" => "0", "id" => "0") ); #menus $s_sql = "SELECT idMenu,url,urlA FROM menus WHERE url!='/' and url!='' order by url"; $result = mysqli_query($dbc,$s_sql); while($row=mysqli_fetch_array($result)) { $leurl = $row['url']; $laroute = array( "url" => "/(\/$leurl)(|\/|(\?|\/\?)([a-zA-Z0-9+\.\/=&_]+))$/", "page" => "page", "type" => "m", "id" => $row['idMenu']); array_push($routes,$laroute); $leurl = $row['urlA']; $laroute = array( "url" => "/(\/en\/$leurl)(|\/|(\?|\/\?)([a-zA-Z0-9+\.\/=&_]+))$/", "page" => "page", "type" => "m", "id" => $row['idMenu']); array_push($routes,$laroute); } # sousmenus $s_sql = "SELECT idSousmenu,sousmenus.url,sousmenus.urlA,menus.url as murl,menus.urlA as murlA FROM sousmenus LEFT JOIN menus ON menus.idMenu=sousmenus.idMenu order by url"; $result = mysqli_query($dbc,$s_sql); if($result) { if(mysqli_num_rows($result)) { while($row=mysqli_fetch_array($result)) { $leurl = $row['url']; $leurlM = $row['murl']; $laroute = array( "url" => "/(\/$leurlM\/$leurl)(|\/|(\?|\/\?)([a-zA-Z0-9+\.\/=&_]+))$/", "page" => "page", "type" => "s", "id" => $row['idSousmenu']); array_push($routes,$laroute); $leurl = $row['urlA']; $leurlM = $row['murlA']; $laroute = array( "url" => "/(\/en\/$leurlM\/$leurl)(|\/|(\?|\/\?)([a-zA-Z0-9+\.\/=&_]+))$/", "page" => "page", "type" => "s", "id" => $row['idSousmenu']); array_push($routes,$laroute); # soussousmenus $s_sql = 'SELECT idSoussousmenu,soussousmenus.url,soussousmenus.urlA,sousmenus.url as surl,sousmenus.urlA as surlA FROM soussousmenus LEFT JOIN sousmenus ON sousmenus.idSousmenu=soussousmenus.idSousmenu WHERE soussousmenus.idSousmenu=' . $row['idSousmenu'] . ' order by soussousmenus.url'; $resultsous = mysqli_query($dbc,$s_sql); if($resultsous) { if(mysqli_num_rows($resultsous)) { while($rowsous=mysqli_fetch_array($resultsous)) { $leurl = $rowsous['url']; $leurlS = $rowsous['surl']; $leurlM = $row['murl']; $laroute = array( "url" => "/(\/$leurlM\/$leurlS\/$leurl)(|\/|(\?|\/\?)([a-zA-Z0-9+\.\/=&_]+))$/", "page" => "page", "type" => "ss", "id" => $rowsous['idSoussousmenu']); array_push($routes,$laroute); $leurl = $rowsous['urlA']; $leurlS = $rowsous['surlA']; $leurlM = $row['murlA']; $laroute = array( "url" => "/(\/en\/$leurlM\/$leurlS\/$leurl)(|\/|(\?|\/\?)([a-zA-Z0-9+\.\/=&_]+))$/", "page" => "page", "type" => "ss", "id" => $rowsous['idSoussousmenu']); array_push($routes,$laroute); } } } } } } #brands $s_sql = "SELECT idBrands,brand,url,urlA FROM brands WHERE url!='/' and url!='' order by url"; $result = mysqli_query($dbc,$s_sql); while($row=mysqli_fetch_array($result)) { $leurl = $row['url']; $laroute = array( "url" => "/(\/$leurl)\/(?P
[a-zA-Z0-9+_\-]*)\/(?P[a-zA-Z0-9+_\-]*)\/(?P[a-zA-Z0-9+_\-]*)(|\/|\?|\?([a-zA-Z0-9+\/=&_%\+\-\[\]]+))$/", "page" => "boutique-brand", "brand" => $leurl, "id" => $row['idMenu']); array_push($routes,$laroute); $laroute = array( "url" => "/(\/$leurl)(|\/|(\?|\/\?)([a-zA-Z0-9+\.\/=&_]+))$/", "page" => "boutique-brand", "brand" => $leurl, "id" => $row['idMenu']); array_push($routes,$laroute); $leurl = $row['urlA']; $laroute = array( "url" => "/(\/en\/$leurl)(|\/|(\?|\/\?)([a-zA-Z0-9+\.\/=&_]+))$/", "page" => "boutique-brand", "brand" => $leurl, "id" => $row['idMenu']); array_push($routes,$laroute); # boutique / categorie /*array( "url" => "/(\/(boutique|en\/shop)\/(?P
[a-zA-Z0-9+_\-]*)\/(?P[a-zA-Z0-9+_\-]*)\/(?P[a-zA-Z0-9+_\-]*)(|\/|\?|\?([a-zA-Z0-9+\/=&_%\+\-\[\]]+)))$/", "page" => "boutique-categorie"), # boutique / marque array( "url" => "/(\/(boutique|en\/shop)\/(?P
[a-zA-Z0-9+_\-]*)\/(?P[a-zA-Z0-9+_\-]*)(|\/|\?|\?([a-zA-Z0-9+\/=&_%\+\-\[\]]+)))$/", "page" => "boutique-marque"), # boutique / marque array( "url" => "/(\/(boutique|en\/shop)\/(?P
[a-zA-Z0-9+_\-]*)(|\/|\?|\?([a-zA-Z0-9+\/=&_%\+\-\[\]]+)))$/", "page" => "boutique-section"), */ } // on loop dans l'array routes pour trouver un url qui match foreach($routes as $urls => $route) { // si y a un match rajoute le array trouvé dans $params if(preg_match($route["url"], $url, $matches)) { switch($route['page']) { case 'page' : $id = $route['id']; $type = $route['type']; $idM = $route['idM']; if($type=='m' && $id=='23') require("page-contact.php"); else require("page.php"); exit(); break; case 'index' : $id = $route['id']; $type = $route['type']; require("index.php"); exit(); break; case 'logout' : echo "OK"; require("logout.php"); exit(); break; case 'nouvelles' : $id = 22; $type = $route['type']; require("page-nouvelles.php"); exit(); break; case 'nouvelles2' : $id = 22; $idNouvelle = $route['id']; $type = $route['type']; require("page-nouvelles-detail.php"); exit(); break; case 'moncompte' : $id = 3; require("page-moncompte.php"); exit(); break; case 'moncompte-informations' : $id = 4; require("page-moncompte-informations.php"); exit(); break; case 'moncompte-tableaudebord' : $id = 5; require("page-moncompte-dashboard.php"); exit(); break; case 'moncompte-motdepasse' : $id =11; require("page-moncompte-motdepasse.php"); exit(); break; case 'reinitialiser' : $id = 6; require("page-reinitialiser-mot-de-passe.php"); exit(); break; case 'boutique' : $id = 16; require("page-boutique.php"); exit(); break; case 'boutique-detail' : $id = 16; $url_section = $matches['section']; $url_marque = $matches['marque']; $url_categorie = $matches['categorie']; $url_produit = $matches['url']; require("page-boutique-detail.php"); exit(); break; case 'boutique-categorie' : $id = 16; $url_marque = $matches['marque']; $url_categorie = $matches['categorie']; $url_section = $matches['section']; require("page-boutique.php"); exit(); break; case 'boutique-marque' : $id = 16; $url_marque = $matches['marque']; $url_section = $matches['section']; require("page-boutique.php"); exit(); break; case 'boutique-section' : $id = 16; $url_section = $matches['section']; require("page-boutique.php"); exit(); break; case 'boutique-brand' : $id = 16; $url_brand = $route['brand']; $url_marque = $matches['marque']; $url_categorie = $matches['categorie']; $url_section = $matches['section']; require("page-boutique.php"); exit(); break; case 'boutique-promotion' : $id = 16; $promo = true; require("page-boutique.php"); exit(); break; case 'boutique-look' : $id = 16; $url_look = $matches['look']; require("page-boutique.php"); exit(); break; case 'panier' : $id = 4; require("page-panier.php"); exit(); break; case 'caisse' : $id = 7; require("page-caisse.php"); exit(); break; case 'caisse2' : $id = 8; require("page-caisse2.php"); exit(); break; case 'confirmation' : $id = 9; require("page-confirmation.php"); exit(); break; case 'commande' : $id = 18; $idProduit = $matches['id']; require("page-commande.php"); exit(); break; } } } require("404.php"); ?>